%% Modyfikacja stanow
function [Lambda] = ml(Lambda, m, n)

[M, N] = size(Lambda);

neib = [ m m-1 m m+1; n-1 n n+1 n];

Lambda(m, n) = uint8(~(bitand(Lambda(m,n), 1))) + uint8(bitand(Lambda(m,n), 30));

for i = neib
    x = i(1);
    y = i(2);

    if x > 1 && y > 1 && x < M && y < N
        Lambda(x, y) = bitand(Lambda(x, y), 1) ...
                + bitand(Lambda(x, y-1), 1) .* 2 ...
                + bitand(Lambda(x-1, y), 1) .* 4 ...
                + bitand(Lambda(x, y+1), 1) .* 8 ...
                + bitand(Lambda(x+1, y), 1) .* 16;
    end
end
